﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace shop.util
{
    public class RequestUtil
    {
        public static int ParseStringToInt(HttpRequest Request,string key) {
            int value = 0;
            try
            {
                value = int.Parse(Request[key]);
            }
            catch (Exception e)
            {

                value = 0;
                Console.Write(e.Message);
            }
            return value;

        }

        public static double ParseStringToDouble(HttpRequest Request, string key)
        {
            double value = 0;
            try
            {
                value = double.Parse(Request[key]);
            }
            catch (Exception e)
            {

                value = 0;
                Console.Write(e.Message);
            }
            return value;

        }
    }
}